<ui:component xmlns="http://www.w3.org/1999/xhtml"  
     		xmlns:f="http://java.sun.com/jsf/core"
    		xmlns:h="http://java.sun.com/jsf/html"
    		xmlns:ui="http://java.sun.com/jsf/facelets"
    		xmlns:p="http://primefaces.prime.com.tr/ui"> 


<p:panel header="Cadastro de Professor" style="width: 550;">
	<h:form>
	<p:wizard widgetVar="wiz"  backLabel="Anterior" nextLabel="Próximo" 
             flowListener="#{professorBean.professor.onFlowProcess}"
             height="250" width="600" speed="175" effect="toggle" >  
       
        <p:tab id="pessoal" title="Pessoal" >  
   
             <p:panel >  
               
               <h:panelGrid columns="2" columnClasses="label, value" styleClass="grid">  
                    
                     <h:outputText for="nome" value="Nome:" />  
                     <p:inputText 
                     	id="nome" 
                     	required="true" 
                     	label="Nome" 
                     	size="40" 
                        value="#{alunoBean.aluno.nome}" />  
                             
                     <h:outputLabel for="dataNascimento" value="Data de Nascimento:" />
           			<p:calendar id="dataNascimento" 
           				value="#{alunoBean.aluno.dataNascimento}" 
           				mode="popup" showOn="button" 
           				locale="pt_BR"
           				autocomplete="true"
           				size="10"
           				pattern="dd/MM/yyyy" navigator="true"/>

             
			<h:outputLabel for="sexo" value="Sexo:" />
			<p:selectOneRadio id="sexo" value="#{alunoBean.aluno.sexo}">
				<f:selectItems value="#{alunoBean.aluno.sexos}" /> 
			</p:selectOneRadio>
             
			
			<h:outputLabel for="cpf" value="Número do CPF:" />
          	 <p:inputMask 
          	 	id="cpf" 
          	 	value="#{alunoBean.aluno.cpf}" 
          	 	label="CPF" 
          	 	size="15"
          	 	required="true" 
          	 	mask="999.999.999-99"/>

			<h:outputLabel for="matricula" value="Matrícula Siape:" />
          	 <p:inputMask  
          	 	id="matricula" 
          	 	value="#{alunoBean.aluno.matricula}" 
          	 	label="Matrícula" 
          	 	size="7"
          	 	mask="9999999"
          	 	required="true" 
          	 	/>
         
          	<h:outputLabel for="curso" value="Curso:" />
			<p:selectOneMenu id="curso" value="#{alunoBean.curso.curso.id}" effect="drop" >
		
				<f:selectItem itemLabel="Selecione..." itemValue="" />  
				<f:selectItems  value="#{cursoBean.cursosCadastrados}" /> 
			
			 	
			</p:selectOneMenu>
			
     		 </h:panelGrid>  
            </p:panel>  
         </p:tab >  
         
        <p:tab id="endereco" title="Endereço">  
             <p:panel>  
                   
                 <h:messages errorClass="error"/>  
               
                 <h:panelGrid columns="2" columnClasses="label, value">  
                 
                 <h:outputText value="Rua:" />  
                     <p:inputText
                     	required="true" 
                     	label="Rua" 
                     	size="40" 
                     	value="#{alunoBean.endereco.rua}" /> 
                  <h:outputText value="Bairro:" />  
                     <p:inputText
                     	required="true" 
                     	label="Bairro" 
                     	size="20" 
                     	value="#{alunoBean.endereco.bairro}" /> 
                  <h:outputText value="Cidade:" />  
                     <p:inputText
                     	required="true" 
                     	label="Cidade" 
                     	size="20" 
                     	value="#{alunoBean.endereco.cidade}" /> 
                  <h:outputText value="CEP:" />  
                     <p:inputMask
                     	required="true" 
                     	label="CEP" 
                     	size="9" 
                     	mask="99.999-999"
                     	value="#{alunoBean.endereco.cep}" />       
                    
                   <h:outputText for="estado" value="Estado:" /> 
                   <p:inputText id="estado" value="#{alunoBean.endereco.estado}" size="2" label="Estado" />
                   
                 </h:panelGrid>  
             </p:panel>  
         </p:tab> 
                                  
        <p:tab id="contato" title="Contato">  
             <p:panel>  
                   
                 <h:messages errorClass="error"/>  
               
                 <h:panelGrid columns="2" columnClasses="label, value">  
                 
                 <h:outputText value="Telefone:" />  
                     <p:inputMask
                     	required="true" 
                     	label="Telefone" 
                     	size="13" 
                     	mask="(99)9999-9999"
                        value="#{alunoBean.telefone.numero}" /> 
                        
                     <h:outputText value="Email:" />  
                     <p:inputText 
                     	required="true" 
                     	label="Email" 
                     	size="40" 
                        value="#{alunoBean.aluno.email}" />  
                       
                 </h:panelGrid>  
             </p:panel>  
         </p:tab>  
         
        <p:tab id="user" title="Usuário">  
             <p:panel >  
               
                 <h:messages errorClass="error"/>  
                   
                 <h:panelGrid columns="2" columnClasses="label, value">  
                    <h:outputLabel for="usuario" value="Login:" />
           			<p:inputText id="usuario" value="#{alunoBean.aluno.login}" label="Login" required="true"/>
           
           			<h:outputLabel for="senha" value="Senha:" />
           			
          			<p:password 
          				id="senha" 
          				value="#{alunoBean.aluno.senha}"  
          				label="Senha" 
          				required="true"
          				promptLabel="Digite sua senha"
          				weakLabel="Fraca"
          				goodLabel="Forte"
          				strongLabel="Muito Forte"/>
    				
                 </h:panelGrid>  
             </p:panel>  
         </p:tab>  
        
        <p:tab id="confirma" title="Confirmar">  
           <p:growl id="growl" sticky="true" showDetail="true"/>  
             <p:panel >  
             
                 <p:separator/>  
                
                <p:separator>Pessoal</p:separator>
                 <h:panelGrid id="confirmacaoPessoal" columns="2">  
                 
                     <h:outputText value="Nome: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.aluno.nome}" />  
                             
                     <h:outputText value="Data de Nascimento: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.aluno.dataNascimento}" >  
                          <f:convertDateTime 
                          	pattern="dd/MM/yyyy"
    						 />
                      </h:outputText>  
                      
                     <h:outputText value="Sexo: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.aluno.sexo}" /> 
                       
                        
                     <h:outputText value="CPF: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.aluno.cpf}" />  
                       
                         
                     <h:outputText value="Matrícula: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.aluno.matricula}" /> 
                                 
                 </h:panelGrid>  
                 <p:separator/>  
                <p:separator>Endereço</p:separator>
                  <h:panelGrid id="confirmacaoEndereco" columns="2">  
                 
                    <h:outputText value="Rua: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.endereco.rua}" />  
                                 
                      <h:outputText value="Bairro: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.endereco.bairro}" />  
                                 
                     <h:outputText value="Cidade: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.endereco.cidade}" />  
                      
                      
                     <h:outputText value="Estado: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.endereco.estado}" /> 
                    
                     <h:outputText value="CEP: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.endereco.cep}" /> 
        
                 </h:panelGrid> 
                  <p:separator/>  
                <p:separator>Usuário/Contato</p:separator>
                 <h:panelGrid id="confirmacaoContato" columns="2"> 
                 <h:outputText value="Usuário: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.aluno.login}" />  
                       
                     <h:outputText value="Email: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.aluno.email}" />  
                     
                     <h:outputText value="Telefone: " />  
                     <h:outputText styleClass="outputLabel"  
                                 value="#{alunoBean.telefone.numero}" /> 
                                 
                 </h:panelGrid> 
                  <p:separator/>  
                 <p:commandButton value="Confirmar" ajax="false"
                             actionListener="#{alunoBean.cadastrarAluno}" />  
               
             </p:panel>  
         </p:tab>  
           
     </p:wizard>  
  
     <p:ajaxStatus>  
         <f:facet name="start">  
             <h:graphicImage value="/resources/images/ajaxloading.gif" />  
         </f:facet>  
           
         <f:facet name="complete">  
             <h:outputText value="" />  
         </f:facet>  
     </p:ajaxStatus>  
 	 
 	 </h:form>
</p:panel>

</ui:component>
